#include"speed_pid_ctr.h"
void speedPid::parameterReconfigCB(pure_pursuit_pkg::speedPidConfig &config)//pid 参数配置回调函数
{
    Kp=config.speedKp;
    Ki=config.speedKi;
    Kd=config.speedKd;
    IntergrationDownLimit=config.speedIntergrationDownLimit;
    IntergrationUplimit=config.speedIntergrationUplimit;
    downLimit=config.speedDownLimit;
    upLimit=config.speedUpLimit;
    ROS_INFO("speed pid parameter is reconfigured: %f %f %f", 
        Kp,Ki,Kd);
    ROS_INFO("%f %f %f %f", 
        IntergrationDownLimit,IntergrationUplimit,\
        downLimit,upLimit);
}

speedPid::speedPid(double Kp_local,double Ki_local,double Kd_local,double deltaTime_local):\
    clampPid(Kp_local,Ki_local,Kd_local,deltaTime_local)
{
    server.setCallback(boost::bind(&speedPid::parameterReconfigCB, this, _1));
}
speedPid::speedPid( double Kp_local,double Ki_local,double Kd_local,\
              double deltaTime_local,\
              double downLimit_local,\
              double upLimit_local,\
              double IntergrationDownLimit_local,\
              double  IntergrationUplimit_local ):\
            clampPid( Kp_local,Ki_local, Kd_local,\
                deltaTime_local,\
                downLimit_local,\
                upLimit_local,\
                IntergrationDownLimit_local,\
                IntergrationUplimit_local )
{    
    server.setCallback(boost::bind(&speedPid::parameterReconfigCB, this, _1));
}


